import React from 'react'
import { useLocation, useParams, useSearchParams } from 'react-router-dom'
 
export default function Detail(props) {
  console.log(props)
  // 获取路由 param参数
  // const {id, title, content} = useParams()
  
  // 获取 search参数
  const [search, setSearch] = useSearchParams()
  const id = search.get('id')
  const title = search.get('title')
  const content = search.get('content')

  // 获取state参数
  // const {state:{id, title, content}} = useLocation()

  return (
    <div>
      <ul>
        <li>编号:{id}</li>
        <li>标题:{title}</li>
        <li>内容:{content}</li>
      </ul>
      

    </div>
  )
}
